WPF and Silverlight Edition Basic Library > Menu and ContextMenu > Menu and ContextMenu Features > Boundary Detection |
Boundary detection ensures that the menus a user opens will always stay within the page bounds. This is helpful if you have several nested submenus within your menu, as these menus can expand until they're beyond the scope of a project page.
The image below illustrates a menu contained with a boundary large enough to allow for the expansion of two submenus.
The image below illustrates what that same menu would look like if the boundaries were shifted several centimeters to the left with the boundary detection feature disabled. Observe that the menu is cut off despite there being an extensive blank space to the left of the control.
The image below illustrates that same menu and same boundary, only this time boundary detection is enabled. Observe that the submenus shift to the left to avoid being cut off by the tight boundary on the right side of the page.
By default, boundary detection is disabled, but you can enable it by setting the DetectBoundaries property to True.
To enable boundary detection, use one of the following methods:
Complete the following steps:
Complete the following steps:
Visual Basic Copy Code C1Menu1.DetectBoundaries = True
C# Copy CodeC1Menu1.DetectBoundaries = true;
Complete the following steps:
The control's properties appear underneath the Properties window.